// 三级分类接口
//导入axios
import request from "@/utils/request"
//引入类型约束文件
import type  { CatgoryListModel } from "@/api/product/model/CategoryListModel"
//枚举三级接口
enum Api {
  getCategory1Api = '/admin/product/getCategory1',
  getCategory2Api = '/admin/product/getCategory2',
  getCategory3Api ='/admin/product/getCategory3'
}

//定义获取三级分类的接口
export   const reqGetCategory1Data =()=> request.get<any,CatgoryListModel>(Api.getCategory1Api);
//定义获取二级分类
export const reqGetCategory2Data = (category1Id: number) => request.get<any, CatgoryListModel>(Api.getCategory2Api + `/${category1Id}`)
//获取三级分类的数据
export const reqGetgory3Data = (category2Id: number) => request.get<any, CatgoryListModel>(Api.getCategory3Api+`/${category2Id}`)